import React,{Component} from 'react'
import Item from '../Item'
// import PropTypes from 'prop-types'
export default class List extends Component{
  // static PropTypes = {
  //   deleteTwo:PropTypes.func,
  //   changeActionFather:PropTypes.func
    
  // }
  deletOne=(id)=>{
    console.log('子组件点击的元素id值为'+id);
    const { deleteTwo }=this.props
    deleteTwo(id)
  }
  changeAction=(id,val)=>{
    const {changeActionFather}=this.props
    console.log(id,val,this.props);
    changeActionFather(id,val)
  }
  render(){
    const {todo}=this.props
    return (
      <div>
        {
          todo.map((val,index)=>{
            return <Item content={val} key={val.id} deletOne={this.deletOne} changeAction={this.changeAction}/>
          })
        }
      </div>
    )
  }
}

